<template>
	<view class="invite">
		<image style="width: 100%;height: 100%;" :src="memberInfo.invite_qrcode_url" mode="aspectFill"></image>
	</view>
	<!-- <view class="con">
		<view class="code">
			邀请码:{{memberInfo.spread_code}}
		</view>
		<view class="img">
			<image style="width: 180px;height: 180px;border: 1px solid #e6e6e6;" :src="memberInfo.invite_qrcode_url"
				mode="aspectFill">
			</image>
		</view>
	</view> -->
</template>

<script setup>
	import request from '@/utils/request';
	import checkLogin from '@/utils/login';
	import {
		ref,
		reactive,
		toRefs,
		inject
	} from 'vue';
	import {
		onLoad,
		onPullDownRefresh,
		onReachBottom,
	} from '@dcloudio/uni-app';

	const state = reactive({
		memberInfo: [],
	});

	onLoad((opt) => {
		//登录过期自动登录
		if (!checkLogin()) {
			pageRoute('/pages/users/login/login');
		} else {
			getMemberInfo();
		}
	});

	function getMemberInfo() {
		request.get('member/getMemberInfo').then(res => {
			state.memberInfo = res.data;
		})
	}

	function pageRoute(url) {
		uni.navigateTo({
			url
		});
	}

	const {
		memberInfo
	} = toRefs(state);
</script>

<style lang="scss">
	page {
		width: 100%;
		height: 100%;
	}

	.invite {
		width: 100%;
		height: 100%;
		// background-image: url(https://jpyx.ynyysc.com/uploads/images/invate-bg.jpg);
		background-size: 100% 100%;
		background-repeat: no-repeat;

	}

	.con {
		width: 60%;
		height: 240px;
		background-color: #fff;
		position: fixed;
		top: 55%;
		left: 20%;
		z-index: 999;

		.code {
			width: 80%;
			text-align: center;
			background-color: #f72b2a;
			color: #fff;
			margin: 0px auto;
			line-height: 40px;
			margin-top: -18px;
		}

		.img {
			padding: 20px 20px;
			text-align: center;
		}
	}
</style>